Skip to content

Conversation

@Porta048
Copy link
Contributor

@Porta048 Porta048 commented Aug 30, 2025

regexes.ts:

Refactored regex patterns for better precision and maintainability:

  • Eliminated code duplication: Replaced duplicate idnEmail regex with a reference to unicodeEmail to reduce
    redundancy
  • Enhanced number validation: Added support for negative numbers in bigint and integer patterns
  • Improved exact matching: Updated boolean, null, and undefined regexes to use precise anchors (^...$)
    instead of partial matches
  • Expanded IPv6 support: Replaced simplified IPv6 regex with a more comprehensive pattern that handles
    additional valid IPv6 address formats
  • Fixed character ordering: Corrected the character sequence in base64url helper function for consistency

These changes improve validation accuracy, reduce bundle size through deduplication, and maintain backward
compatibility while making the codebase cleaner and more maintainable.

Closes #5061

@vercel
Copy link

vercel bot commented Aug 30, 2025

@Porta048 is attempting to deploy a commit to the colinhacks' projects Team on Vercel.

A member of the Team first needs to authorize it.

@colinhacks
Copy link
Owner

Normally not a fan of big PRs that make a lot of changes at once....but yeah these are all great 👍 Thanks! Good catches all around.

@colinhacks colinhacks merged commit 27f13d6 into colinhacks:main Sep 11, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

z.int() rejects negative integers in a z.templateLiteral()

2 participants